package Exists;

import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class Demo01 {
    public static void main(String[] args) {


        getDay(LocalDate.of(2020, 1, 15));
    }

    private static void getDay(LocalDate of) {


        DayOfWeek dayOfWeek = of.getDayOfWeek();
        if (dayOfWeek.equals(DayOfWeek.SATURDAY) || dayOfWeek.equals(DayOfWeek.SUNDAY)) {
            LocalDate res = of.withDayOfMonth(17);
            String num = res.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日"));
            System.out.println("发薪水的时间为:" + num);
        } else {

            String num1 = of.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日"));

            System.out.println("发薪水时间为:" + num1);
        }


    }


}
